function out = soft_threshold( u, s, g)
t  = u;
out = g;
out(t-g > s)= t(t-g>s)-s;
out(t-g < -s) = t(t-g< -s)  + s;
end